//
//  LEStoreHeader.m
//  LoveExpressBusiness
//
//  Created by 刘甲奇 on 2017/5/10.
//  Copyright © 2017年 DFH. All rights reserved.
//

#import "LEStoreHeader.h"
@interface LEStoreHeader()

@end
@implementation LEStoreHeader
- (void)awakeFromNib
{
    [super awakeFromNib];
    //初始化CAGradientlayer对象，使它的大小为UIView的大小
    CAGradientLayer *gradualLayer = [CAGradientLayer layer];
    gradualLayer.frame = CGRectMake(0, 0, LEScreenWidth, 100);
    
    //将CAGradientlayer对象添加在我们要设置背景色的视图的layer层
    [self.layer insertSublayer:gradualLayer atIndex:0];
    
    //设置渐变区域的起始和终止位置（范围为0-1）
    gradualLayer.startPoint = CGPointMake(0, 1);
    gradualLayer.endPoint = CGPointMake(0, 0);
    
    //设置颜色数组
    gradualLayer.colors = @[(__bridge id) LEHaxColor(0x5585ce).CGColor,
                            (__bridge id)LEHaxColor(0x87cefa).CGColor];
    
    //设置颜色分割点（范围：0-1）
//    gradualLayer.locations = @[@(0.5f), @(1.0f)];
    
}


@end
